const AppAccessTokenName = 'app_access_token'

export default {
  // 设置本地存储
  setToken: function (token, expires) {
    window.sessionStorage.setItem(AppAccessTokenName, JSON.stringify(token))
  },
  // 获取本地存储
  getToken: function () {
    return JSON.parse(window.sessionStorage.getItem(AppAccessTokenName))
  },
  // 判断是否登录
  isLogin: function () {
    return window.sessionStorage.getItem(AppAccessTokenName)
  },
  // 注销本地存储
  removeToken: function () {
    return window.sessionStorage.removeItem(AppAccessTokenName)
  },
  // 清空所有的数据
  clearStorage: () => window.sessionStorage.clear()
}
